class Person{
    constructor(name){
        this.name = name;
    }

    sayName(){
        console.log(this.name);
    }
    //静态方法
    static hot(thing){
        console.log("爱好"+thing)
    }
}

let p1 = new Person('zs');


// console.log(p1.__proto__ === Person.prototype)

// console.log(p1)

p1.sayName();

console.log(p1.name)

console.log(p1)

//实例调用类的prototype上的方法和属性

//类的静态方法一定要用类来调用

Person.hot('踢足球')

// p1.hot('3133')

//==================================

//Array.from()  把类数组转成真正的数组

function sum(...nums){
    // console.log(Array.from(arguments))//类数组

    console.log(nums)
}

sum(1,2,3,4);

//Array.of()   把一组值转为数组

let arr = Array.of(1,2,3,4,5);

console.log(arr);

//fill 填充

let arr1 = new Array(3);

arr1.fill('a');

console.log(arr1)

console.log(arr1.keys())

// for(let i of arr1.keys()){
//     console.log(i)
// }

let inter = arr1.entries();

console.log(inter.next())
console.log(inter.next())
console.log(inter.next())
console.log(inter.next());

console.log([1, 2, [3, [4, 5]]].flat(2))


